<template>
    <div>
        {{this.$store.state.msg}}====
    </div>
</template>

<script>
export default {
    data(){
        return  {}
    }
}
</script>



store.js======
state：{
    msg:123
}，
mutations:{
    aa(state,obj){},
    qs(state,dd){

    }

},
getters:{
    qq(state){
        return  state.msg
    }
}

app.vue======

获取
$store.state.msg
$store.getters.qq

存储===
data(){
    return  {
        zz:123
    }
}
methods:{
    add(){
        this.$store.commit("qs",this.zz)
    }
}







